﻿Imports BUS
Imports DTO

Public Class frmcapnhatchucvu

    Private Sub btnthoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnthoat.Click
        Me.Close()
    End Sub

    Public Sub LoadChucVu()
        dtgvdschucvu.Rows.Clear()
        Dim ds As New List(Of ChucVuDTO)()
        Dim bus As New ChucVuBUS()
        ds = bus.LayDSChucVu()
        For i As Integer = 0 To ds.Count - 1
            dtgvdschucvu.Rows.Add(ds(i).MaChucVu, ds(i).TenChucVu)
        Next
    End Sub

    Private Sub frmcapnhatchucvu_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadChucVu()
    End Sub

    Private Sub btncapnhat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncapnhat.Click
        If dtgvdschucvu.CurrentRow.Index >= 0 Then
            Dim frm As New frmxlcapnhatchucvu()
            frm.MaChucVu = dtgvdschucvu.Item(0, dtgvdschucvu.CurrentRow.Index).Value
            If frm.ShowDialog() = Windows.Forms.DialogResult.OK Then
                LoadChucVu()
            End If
        Else
            MessageBox.Show("Chưa chọn bằng cấp !")
        End If
    End Sub
End Class